/**
 * Created by Administrator on 2017\9\21 0021.
 */

//确认
function savesuccess(id, hh) {
	var work_order_id = $("input[name='workOrderStatus" + id + "']").val();
	var work_order_status = $("#_orderStatus" + work_order_id + " option:selected").val();
	var remarks = $("#remarks" + work_order_id).val();
	
	
	
	if(hh == 1) { // 续费
		var srcs = "/administrative/workorder/renew";
	}
	if(hh == 2) { // 换芯
		var srcs = "/administrative/workorder/core";
	}
	if(hh == 3) { // 未指派
		var srcs = "/administrative/workorder/unassigned";
	}
	if(hh == 4) { // 已指派
		var srcs = "/administrative/workorder/assigned";
	}
	if(hh == 5) { // 详情页面操作
		var srcs = "/administrative/workorder/detail?id=" + id;
	}

	$.getJSON("/administrative/workorder/status", {
		remarks: remarks,
		work_order_status: work_order_status,
		work_order_id: work_order_id
	}, function(data) {
		
		if(data.status == 0) {
			parent.layer.msg(data.message, {
				time: 3000,
				icon: 2
			});
		} else {
			parent.layer.msg(data.message, {
				time: 2000,
				icon: 1
			});
			$("#mainFrame").attr("src", srcs)
		}
	});

	$(".layui-layer-shade").remove();
	$(".layui-layer").remove();

}

//取消
function layuihide() {
	$(".layui-layer").remove();
	$(".layui-layer-shade").remove();
}